<template>
    <van-nav-bar
title="推荐详情"
left-text=""
left-arrow
@click-left="onClickLeft"
/>  
<div>
    <van-tabs v-model="activeMainTab" >
      <van-tab title="邀请详情" >
        <van-tabs v-model="activeSubTab1">
          <van-tab :title="`一级邀请(${firstcount})`">
            <van-cell-group>
    <van-cell v-for="(row, index) in firstList" :key="index">
      <template #title>
        <div class="table-row">
          <span v-for="(cell, cellIndex) in row" :key="cellIndex" class="table-cell" >{{ cell }}</span>
        </div>
      </template>
    </van-cell>
  </van-cell-group>
          </van-tab>
          <van-tab :title="`二级邀请(${secondcount})`">
            <van-cell-group>
    <van-cell v-for="(row, index) in secondList" :key="index">
      <template #title>
        <div class="table-row">
          <span v-for="(cell, cellIndex) in row" :key="cellIndex" class="table-cell" >{{ cell }}</span>
        </div>
      </template>
    </van-cell>
  </van-cell-group>
          </van-tab>
        </van-tabs>
      </van-tab>
      <van-tab :title="`收益详情(${reward}usdt)`">
        <van-cell-group>
    <van-cell v-for="(row, index) in rewardList" :key="index">
      <template #title>
        <div class="table-row">
          <span v-for="(cell, cellIndex) in row" :key="cellIndex" class="table-cell" >{{ cell }}</span>
        </div>
      </template>
    </van-cell>
  </van-cell-group>
      </van-tab>
    </van-tabs>
</div>

</template>
<script setup>
import { onMounted } from 'vue'
import { ref,reactive } from 'vue'
import {_getMyWallet,_selectMyWallet,_getItemBySymbol,_getInviteUser,_getInviteMoneyUser} from '@/service/my.js'

const firstcount = ref(0);
const reward = ref(0);
const secondcount= ref(0);
const firstList = ref({});
const secondList = ref({});
const rewardList = ref({});


onMounted(() => {
    getInviteUser()
    getInviteMoneyUser()
});

const getInviteUser = () => {
  _getInviteUser({
       
    }).then((res) => {
      firstList.value = res.firstResultList
      secondList.value = res.secondResultList
      firstcount.value = res.firstAll
      secondcount.value = res.secondAll
    })
}
const getInviteMoneyUser = ()=>{
  _getInviteMoneyUser({}).then((res)=>{
    rewardList.value = res.resultList
    reward.value = res.allMoney
  })
}

const onClickLeft = () => history.back();


</script>
<style lang="scss" scoped>
.table-row {
  display: flex;
}
.table-cell {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
}
.van-dialog {
            background-color: #f5f5f5; /* 设置 van-dialog 的背景颜色 */
        }
      .van-dialog__header {
            font-weight: 700; /* 设置 van-dialog 标题字体粗细 */
        }
</style>